using UnityEngine;

namespace DA.AnimGraph {
    internal struct MaskLink {

        private readonly AUID uuid;

        public MaskLink(MaskLinkDesc desc) {
            uuid = desc.uuid;
        }

        internal AvatarMask Get(in BuildContext context) {
            if (!uuid.isValid) return null;
            if (context.resourcesMap.TryGetValue(uuid, out Object obj)) {
                if (obj is AvatarMask mask) {
                    return mask;
                }
            }
            return null;
        }
    }
}
